<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">
<section class="content-header">
    <h1>零件明细查看</h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <form id="queryForm" onsubmit="return false;">
                        <div class="row">
                            <div class="form-inline">
                                <input id="query-proCode" th:value="${proCodeId}" type="hidden" name="proCode"
                                       class="form-control">
                                <input id="query-prodChange" th:value="${prodChange}" type="hidden" name="prodChange"
                                       class="prodChange">
                                <input id="query-specialId" th:value="${special}" type="hidden" name="special"
                                       class="form-control">
                                <input id="query-id" th:value="${id}" type="hidden" name="id"
                                       class="form-id">
                                <input id="query-partId" th:value="${part}" type="hidden" name="part"
                                       class="form-control">
                                <input id="query-recStatus" th:value="${recStatus}" type="hidden" name="recStatus"
                                       class="form-control">
                                <div class="form-group">
                                    <label for="query-drawNo">零件图号</label>
                                    <input id="query-drawNo" type="text" name="drawNo" class="form-control"
                                           placeholder="请输零件图号">
                                </div>
                                <div class="form-group">
                                    <label for="query-drawName">零件图名</label>
                                    <input id="query-drawName" type="text" name="drawName" class="form-control"
                                           placeholder="请输零件图名">
                                </div>
                                <button type="button" class="btn btn-success" id="btn-search"
                                        onclick="js.table.search(table)">
                                    <span class="Bold">搜索</span>
                                </button>
                            </div>
                        </div>
                        <div class="row" style="margin-top: 30px">
                            <div class="form-inline">
                                <div class="form-group">
                                    <label for="query-proCode">项目编号</label>
                                    <input id="query-proCode1" type="text" name="proCode" class="form-control"
                                           style="border: none;width: 100Px;background-color: white"
                                           th:value="${proCodeId}" readonly>
                                </div>
                                <div class="form-group">
                                    <label for="query-proName">项目名称</label>
                                    <input id="query-proName" type="text" name="proName" class="form-control"
                                           style="border: none;width: 300px;background-color: white"  readonly>
                                </div>
                                <div class="form-group">
                                    <label for="query-proNum">项目数量</label>
                                    <input id="query-proNum" type="text" name="proNum" class="form-control"
                                           style="border: none;width: 50PX;background-color: white"   readonly>
                                </div>
                                <div class="form-group">
                                    <label for="query-special">专业</label>
                                    <input id="query-special" type="text" name="special" class="form-control"
                                           style="border: none;width: 88PX;background-color: white"
                                           th:value="${special}" readonly>
                                </div>
                                <div class="form-group">
                                    <label for="query-part">部分</label>
                                    <input id="query-part" type="text" name="part" class="form-control"
                                           style="border: none;width: 200PX;background-color: white"
                                           th:value="${part}" readonly>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="box-body">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    let table;

    $(function () {
        /** 子表 */
        table = js.table.init({
            id: "bootstrap-table",
            queryForm: "queryForm",
            url: ctx + "tecard/selectMakeDetail",
            showExport: false,
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "零件图号", field: 'drawNo',
                    formatter: function (value,row){

                        $("#query-proName").val(row.proName);
                        $("#query-proNum").val(row.proNum);
                        return value;
                    }
                },
                {title: "零件名称", field: 'drawName'},
                {title: "零件数量", field: 'drawNum'},
                {title: "材质", field: 'quality'},
                {title: "规格", field: 'specification'},
                {title: "重量（KG）", field: 'weight'},

                {
                    title: "操作",
                    // width: '160px',
                    formatter: function (value, row) {
                        let actions = [];
                        if(row.isNeedCard==1){
                            actions.push('<a class="btn btn-info btn-xs" target="_blank" href="' + ctx +
                                'tecard/full/' + row.id + '"> 查看</a>');
                        }
                        return actions.join('');
                    }
                }
            ]
        });





    });




</script>
</body>
</html>
